package org.dbstar.scheduler.job;

import org.dbstar.scheduler.beans.CompoundJobConf;
import org.dbstar.scheduler.beans.Job;
import org.dbstar.scheduler.control.JobController;


/**
 * 创建复合Job执行器的工厂类
 * 
 * @author 代波
 * @since 1.0.0
 * @version 1.0.0
 * @date 2012-5-7
 */
public class CompoundJobRunnerFactory implements JobRunnerFactory {
	@Override
	public JobRunner createJobRunner(JobController jobController, Job job) throws IllegalFactoryException {
		if (CompoundJobConf.JOB_TYPE.equals(job.getType())) {
			return new CompoundJobRunner(jobController, job);
		} else {
			throw new IllegalFactoryException("Not a CompoundJob: " + job.getType());
		}
	}
}
